<?php 
/*************************************************************************************
 * manageIndex.php
 * -----------
 * phpGMapTrips 
 * 
 * This php application allows you to easily record your travel destinations 
 * and display them with Google maps.
 * 
 * Author: Stephane Coste (lescoste@gmail.com)
 * Copyright: (c) 2006 Stephane Coste (http://lescoste.net/)
 * Release Version: 0.1
 * CVS Revision Version: $Revision: 1.14 $
 * Date Started: 2006/02/19
 * Last Modified: $Date: 2007/03/08 20:44:30 $
 *
 * CHANGES
 * -------
 * 2006/04/30 (0.5)
 * - internationalization : fr en
 * - display place list on whole page height
 * - added search
 *
 * 2006/03/06 (0.3)
 *  -  First Release
 *
 *************************************************************************************
 *
 *     This file is part of phpGMapTrips.
 *
 *   phpGMapTrips is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   phpGMapTrips is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with phpGMapTrips; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ************************************************************************************/
?>
<?php include_once("config.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include_once("langjs.php"); ?>

<title><?php echo $title; ?></title>
<link rel="icon" href="images/favicon.gif" type="image/gif" />
<link rel="stylesheet" href="gearth.css" type="text/css" media="screen" />
<script type="text/javascript" src="ajaxCaller.js"></script>
<script src="labeltrick.js" type="text/javascript"></script>
<script src="common.js" type="text/javascript"></script>
<script src="managepoints.js" type="text/javascript"></script>

<script type="text/javascript" src="statemanager.js"></script>
<script type="text/javascript" src="stateusage.js"></script>

<style>
body{
background-color:gray;
}
#menutripscontainer , #menupointscontainer , div#editZonecontainer{
background-color:white;
	position:absolute;
	top:5px;
	border:1px solid black;
	overflow:auto;
	padding:2px;
	}
#menutripscontainer {
	left:10px;
	width:30%;
	height:50%;
}
#menupointscontainer {
	left:33%;
	width:30%;
	height:80%;
}
div#editZonecontainer{
	left:66%;
        width:30%;
	height:50%;
}
div#editZone{
	overflow:visible;
	height:80%;
}
div#pointtools {
   position:absolute;
   top:2em;
   z-index:5;
}
.pointdetails{
   position:absolute;
	width:95%;
   top:5em;
   z-index:8;
}
#edittripiframe{
	position: absolute;
	top: 0;
	left: 0;
       margin:0;
        height:99%;
        width:95%;
   display:none;
   z-index:10;
	}
#menu_tools{
	padding:2px;
background-color:white;
	position:absolute;
	left:66%;
        width:30%;
	bottom:20%;
	border:1px solid black;
}
#langues{
	position:absolute;
	top:2px;
	right:2px;
}
#footzone {
	position:absolute;
	bottom:1em;
	width:90%;
	margin-left:auto;
	margin-right:auto;
}
</style>
</head>
<body>
  
<?php // Tools display area ?>
  <div id="manageZone" >
	<div id="menutripscontainer" >
		<div id="loadingimg" style="display:none;" ><img src="images/loading.gif"/></div>
		<div id="menu" ></div>
  	</div>

	<div id="menupointscontainer" >
		<?php echo $lang_places_title; ?>
		<a href="javascript:void(0);" onclick="exportToKml();" title="<?php echo $lang_export_kml_link; ?>" ><img src="images/google_earth_link.gif" alt="<?php echo $lang_export_kml_link; ?>" /></a>
		<a id="addpointlink" href="javascript:void(0);" onclick="editAddPoint();" title="<?php echo $lang_add_place_link; ?>" ><img src="images/add.gif" alt="<?php echo $lang_add_place_link; ?>" /></a>
		<a id="editcurrenttriplink" href="javascript:void(0);" onclick="editCurrentTrip();" title="<?php echo $lang_edittrip_link; ?>" ><img src="images/edit.gif" alt="<?php echo $lang_edittrip_link; ?>" /></a>

	<div id="menu_places" >
	</div>
		<iframe id="edittripiframe" name="edittripiframename" ></iframe>
	</div>

        <div id="editZonecontainer">
		<?php echo $lang_place_title; ?>
	<div id="langues"><?php
	foreach ($auth_langues as $lang => $language) {
		$flagstyle ="";
		if ($lang == $langue) { $flagstyle = ' style="border:1px outset black;"';}
		echo '<a href="?langue='.$lang.'" title="'.$language.'"><img src="./images/'.$lang.'.gif" '.$flagstyle.' /></a> ';
	}
	?></div>
	    <div id="editZone">
		<div id="p_name"></div>
		<iframe id="editpointiframe" name="editpointiframename" ></iframe>
   	    </div>
	</div>
	<div class="rounded" id="menu_tools">
                <form name="searchbox" method="get" style="display:inline;" onsubmit="if(this.st[0].checked){searchPoint(this.search.value);}else{showAddress(this.search.value);};return false;" >
<label for="search"  class="inside"><?php echo $lang_search_label; ?></label>
<input type="search" name="search" id="search" Value="" size="20" results="5" />
<input type="radio" name="st" value="p" CHECKED /> <?php echo $lang_places_label; ?>
<input type="radio" name="st" value="g" /> <?php echo $lang_newaddress_label; ?>
<br/>
<input type="checkbox" name="visitor" value="visitor" onClick="showVisitor(this.checked);" /> <?php echo $lang_show_visitor_link; ?>
</form>
	</div>
  </div>

  <?php // footer ?>
  <div id="footzone">
  <?php printFooter(); ?>
  </div>


  <script type="text/javascript">

  // load trips list
<?php 
$showfile = urldecode($_GET["showfile"]); 
$showtrip = urldecode($_GET["showtrip"]); 
$showpoint = urldecode($_GET["showpoint"]); 
echo "defaultFile = '".$showfile."';";
echo "default_trip = '".$default_trip."';";
echo "showpoint = '".$showpoint."';";
?>
  callTrips("<?php echo $showfile; ?>", "<?php echo $showtrip; ?>", "<?php echo $showpoint; ?>");

window.onload = labelTrick;

  </script>

</body>
</html>
